package com.lywz.biz.common.entity.goodfood;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import com.lywz.core.entity.AbstractEntity;
import com.lywz.core.entity.EntityAnnotation;

/**
 * @author qianqi yangboling
 *@since 2010-4-27
 */
@Entity
@NamedQueries({@NamedQuery(name="Food.queryFoodByType", query = "from Food where foodTypeId = :foodType"),
               @NamedQuery(name="Food.queryTypedFoodList", query="from Food where foodTypeId = :foodType order by isShowInSecond desc"),
               @NamedQuery(name="Food.queryMainFoodList", query="from Food where foodTypeId = :foodType order by isShowInMain desc"),
               @NamedQuery(name="Food.queryTopSpecalFoodList", query = "from Food where foodTypeId in (1,2,3,4,5) order by isShowInMain desc"),
               @NamedQuery(name="Food.querySpecalFoodList", query="from Food where foodTypeId in (1,2,3,4,5) order by addFoodTime desc"),
               @NamedQuery(name="Food.queryAllTypedFoodListByAddTime", query="from Food where foodTypeId = :foodType order by addFoodTime desc"),
               @NamedQuery(name="Food.queryDrinkTeaListOrderByAddTime", query="from Food where foodTypeId in (8,7) order by addFoodTime desc")})
@EntityAnnotation
@Table(name = "t_food")
public class Food extends AbstractEntity {

    private static final long serialVersionUID = 6659593160287202398L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    protected Integer foodId; //主键id(自增)

    protected String name; //food名字

    protected String imageUrl; //图片地址

    protected String description1; //说明1

    protected String description2; //说明2

    protected String description3; //说明3

    private Date addFoodTime; //该美食添加时间(数据库中自动添加为添加时间,该属性只有get方法)

    private Integer isShowInMain; //该美食是否在美食天地页面显示(默认为-1)

    private Integer isShowInSecond; //该美食是否在特色菜肴页面显示(默认为-1)
   
    private Integer foodTypeId; //该美食属于哪个类别
    
    private String foodTypeName; //该美食列别名称
    
    public void setFoodId(Integer foodId) {
        this.foodId = foodId;
    }

    public void setAddFoodTime(Date addFoodTime) {
        this.addFoodTime = addFoodTime;
    }

    public Integer getFoodId() {
        return foodId;
    }

    public Integer getIsShowInMain() {
        return isShowInMain;
    }

    public Integer getIsShowInSecond() {
        return isShowInSecond;
    }

    public void setIsShowInMain(Integer isShowInMain) {
        this.isShowInMain = isShowInMain;
    }

    public void setIsShowInSecond(Integer isShowInSecond) {
        this.isShowInSecond = isShowInSecond;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getDescription1() {
        return description1;
    }

    public void setDescription1(String description1) {
        this.description1 = description1;
    }

    public String getDescription2() {
        return description2;
    }

    public void setDescription2(String description2) {
        this.description2 = description2;
    }

    public String getDescription3() {
        return description3;
    }

    public void setDescription3(String description3) {
        this.description3 = description3;
    }

    public Date getAddFoodTime() {
        return addFoodTime;
    }

    /**
     * @return the foodTypeId
     */
    public Integer getFoodTypeId() {
        return foodTypeId;
    }

    /**
     * @param foodTypeId the foodTypeId to set
     */
    public void setFoodTypeId(Integer foodTypeId) {
        this.foodTypeId = foodTypeId;
    }

    
    /**
     * @return the foodTypeName
     */
    public String getFoodTypeName() {
        return foodTypeName;
    }

    
    /**
     * @param foodTypeName the foodTypeName to set
     */
    public void setFoodTypeName(String foodTypeName) {
        this.foodTypeName = foodTypeName;
    }

    
}
